package com.xlf.service.base.service.impl.validate;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xlf.common.auth.util.SecurityUtils;
import com.xlf.common.core.constant.Constants;
import com.xlf.common.core.exception.BizException;
import com.xlf.pojo.base.ContestRegister;
import com.xlf.pojo.base.Problem;
import com.xlf.service.base.mapper.ContestProblemMapper;
import com.xlf.service.base.mapper.ContestRegisterMapper;
import com.xlf.service.base.mapper.DifficultyMapper;
import com.xlf.service.base.mapper.ProblemMapper;
import com.xlf.service.base.service.ProblemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author xlf 2734029211@qq.com
 * @Date 2023/11/23 9:42
 * @Description: TODO
 * @Version 1.0
 */
@Service
public class ProblemValidator {

    @Resource
    ProblemMapper problemMapper;

    @Resource
    DifficultyMapper difficultyMapper;

    @Resource
    ContestRegisterMapper contestRegisterMapper;

    public Problem contestProblemValidator(Problem problem){

        //比赛题目
        if(problem.getAuth() == com.xlf.pojo.constant.Constants.ProblemAuth.CONTEST.getCode()){

            Object userId = SecurityUtils.getUserId();
//            contestRegisterMapper.selectCount(new LambdaQueryWrapper<ContestRegister>()
//                    .eq(ContestRegister::getUid,userId)
//                    .eq(ContestRegister::getCid))
        }

        return problem;
    }

}
